home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / TeXsource / commontex / h / token < prev    next >
Encoding:
Text File  |  1988-04-08  |  1.8 KB  |  82 lines

  1. /*
  2.  *    Copyright 1986, 1987 Pat Joseph Monardo. All rights reserved.
  3.  *    Copying of this file is granted according to the provisions 
  4.  *    specified in the file COPYING which must accompany this file.
  5.  */
  6.  
  7.  
  8. /*
  9.  *        token.h
  10.  */
  11.  
  12. global    hword    cur_tok;
  13. global    byte    cur_cmd;
  14. global    hword    cur_chr;
  15. global    ptr        cur_cs;
  16.  
  17. #define    LEFT_BRACE_TOKEN    0400
  18. #define    LEFT_BRACE_LIMIT    01000
  19. #define    RIGHT_BRACE_TOKEN    01000
  20. #define    RIGHT_BRACE_LIMIT    01400
  21. #define    MATH_SHIFT_TOKEN    01400
  22. #define    TAB_TOKEN            02000
  23. #define    OUT_PARAM_TOKEN        02400
  24. #define    SPACE_TOKEN            05040
  25. #define    LETTER_TOKEN        05400
  26. #define    OTHER_TOKEN            06000
  27. #define    MATCH_TOKEN            06400
  28. #define    END_MATCH_TOKEN        07000
  29. #define    CS_TOKEN_FLAG        010000
  30. #define    END_TEMPLATE_TOKEN    CS_TOKEN_FLAG + FROZEN_END_TEMPLATE
  31.  
  32. #define    NO_EXPAND_FLAG        257
  33.  
  34. global    ptr        par_loc;
  35. global    hword    par_token;
  36. global    bool    force_eof;
  37.  
  38. #define    token(T)        tok[T]
  39. #define    token_link(T)    tok_link[T]
  40.  
  41. global    hword    tok[];
  42. global    hword    tok_link[];
  43. global    ptr        tok_head;
  44. global    ptr        tok_low;
  45. global    ptr        tok_end;
  46. global    int        tok_used;
  47.  
  48. #define    temp_toks        TOK_TOP
  49. #define    align_tokens    (TOK_TOP - 1)
  50. #define    omit_template    (TOK_TOP - 2)
  51. #define    null_list        (TOK_TOP - 3)
  52. #define    backup_tokens    (TOK_TOP - 4)
  53. #define    tok_high        (TOK_TOP - 4)
  54. #define    tok_usage        5
  55.  
  56. #ifdef    STAT
  57. #define    fast_new_token(T) \
  58.     {T = tok_head; \
  59.     if (T == NULL) T = new_token(); \
  60.     else {tok_head = token_link(T); token_link(T) = NULL; incr(tok_used);}}
  61. #else
  62. #define    fast_new_token(T) \
  63.     {T = tok_head; \
  64.     if (T == NULL) T = new_token(); \
  65.     else {tok_head = token_link(T); token_link(T) = NULL;}}
  66. #endif
  67.  
  68. int    get_token();
  69. int    get_next();
  70. ptr    new_token();
  71.  
  72. #ifdef STAT
  73. #define free_token(T) \
  74.     {token_link(T) = tok_head; tok_head = T; decr(tok_used);}
  75. #else
  76. #define free_token(T) \
  77.     {token_link(T) = tok_head; tok_head = T;}
  78. #endif
  79.  
  80. int    check_outer_validity();
  81. int    firm_up_the_line();
  82.